package example.logger.matcher;

import com.coderside.core.base.Matcher;
import com.coderside.core.util.ParseUtil;

/**
*auto create by Build Tool
**/
public class DateTimeMatcher implements Matcher {
	public String fetch(String content) {
		int index = content.indexOf(",");
		return content.substring(0, index);
	}

	public boolean match(String content) {
		String regexChoice = "ERROR";
		String date_regexp = "^((((19){1}|(20){1})d{2})|d{2})[-\\s]{1}[01]{1}d{1}[-\\s]{1}[0-3]{1}d{1}$";// 匹配日期
		return ParseUtil.matcherReg(regexChoice, content) && ParseUtil.matcherReg(date_regexp, content);
	}

	public char getType() {
		return example.logger.LoggerInfoHelper.DATETIME;
	}
}
